/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.ProjetoFinal.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

/**
 *
 * @author DCBorges
 */
@Entity
@Table(name = "sdctb012_renda_prtce")
public class RendaParticipante implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_SQNCL_RENDA")
    private Integer nuSqnclRenda;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "VR_RNDA_MDA_CLDA")
    private BigDecimal vrRndaMdaClda;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DT_APURACAO_PRTCE")
    @Temporal(TemporalType.DATE)
    private Date dtApuracaoPrtce;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HH_APURACAO_PRTCE")
    @Temporal(TemporalType.TIME)
    private Date hhApuracaoPrtce;
    @JoinColumns({
        @JoinColumn(name = "NU_SNQCL_GRPO_FMLR", referencedColumnName = "NU_SNQCL_GRPO_FMLR"),
        @JoinColumn(name = "NU_SQNCL_PRTE", referencedColumnName = "NU_SQNCL_PRTE")})
    @ManyToOne
    private ParticipanteGrupo participanteGrupo;

    public RendaParticipante() {
    }

    public RendaParticipante(Integer nuSqnclRenda) {
        this.nuSqnclRenda = nuSqnclRenda;
    }

    public RendaParticipante(Integer nuSqnclRenda, BigDecimal vrRndaMdaClda, Date dtApuracaoPrtce, Date hhApuracaoPrtce) {
        this.nuSqnclRenda = nuSqnclRenda;
        this.vrRndaMdaClda = vrRndaMdaClda;
        this.dtApuracaoPrtce = dtApuracaoPrtce;
        this.hhApuracaoPrtce = hhApuracaoPrtce;
    }

    public Integer getNuSqnclRenda() {
        return nuSqnclRenda;
    }

    public void setNuSqnclRenda(Integer nuSqnclRenda) {
        this.nuSqnclRenda = nuSqnclRenda;
    }

    public BigDecimal getVrRndaMdaClda() {
        return vrRndaMdaClda;
    }

    public void setVrRndaMdaClda(BigDecimal vrRndaMdaClda) {
        this.vrRndaMdaClda = vrRndaMdaClda;
    }

    public Date getDtApuracaoPrtce() {
        return dtApuracaoPrtce;
    }

    public void setDtApuracaoPrtce(Date dtApuracaoPrtce) {
        this.dtApuracaoPrtce = dtApuracaoPrtce;
    }

    public Date getHhApuracaoPrtce() {
        return hhApuracaoPrtce;
    }

    public void setHhApuracaoPrtce(Date hhApuracaoPrtce) {
        this.hhApuracaoPrtce = hhApuracaoPrtce;
    }

    public ParticipanteGrupo getParticipanteGrupo() {
        return participanteGrupo;
    }

    public void setParticipanteGrupo(ParticipanteGrupo participanteGrupo) {
        this.participanteGrupo = participanteGrupo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nuSqnclRenda != null ? nuSqnclRenda.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RendaParticipante)) {
            return false;
        }
        RendaParticipante other = (RendaParticipante) object;
        if ((this.nuSqnclRenda == null && other.nuSqnclRenda != null) || (this.nuSqnclRenda != null && !this.nuSqnclRenda.equals(other.nuSqnclRenda))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.ProjetoFinal.domain.RendaParticipante[ nuSqnclRenda=" + nuSqnclRenda + " ]";
    }
    
}
